import {defineStore} from "pinia";


export const useCountStore = defineStore('count', {
    // 第三种方法
    actions: {
        increment() {
            this.sum += 1;
        }
    },
    state() {
        return {
            sum: 6,
        }
    },
    // 相当于computer
    getters: {
        bigSum(state): number {
            return state.sum * 10;
        },
        bigSum1 : (state) => state.sum * 20,
        bigSum2() : number {
            return this.sum * 30;
        }
    }
});